﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for Demo
/// </summary>
public class Demo
{
	public Demo()
	{
		//
		// TODO: Add constructor logic here
		//
       
	}

    /*
     // generate datatable
        String strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='E://ProjectForGov//JiXieDB.mdb'";
        string sqlCmd = "SELECT * FROM File";
        System.Data.DataTable table = AccessHelper.ExecuteDataTable(strConn, System.Data.CommandType.Text, sqlCmd);
        this.GridView1.DataSource = table;
        this.GridView1.DataBind();

        // generate object
        sqlCmd = "Select max(FileID) from File";
        Object o = AccessHelper.ExecuteScalar(strConn, System.Data.CommandType.Text, sqlCmd);
        TextBox1.Text = o.ToString();


        // insert operation
        FileInfo fi = new FileInfo();
        fi.FatherID = 10;
        fi.FileName = "helloworld";
        fi.Content = "";
        fi.FileTypeID = 3;
        string sql = "INSERT INTO File (FatherID, FileName, Content, FileTypeID) VALUES(@FatherID,@FileName,@Content,@FileTypeID)";
        OleDbParameter[] pars = new OleDbParameter[4];
        pars[0] = AccessHelper.MakeInParam("FatherID", System.Data.OleDb.OleDbType.BigInt, 8, AccessHelper.CheckForNullObject(fi.FatherID));
        pars[1] = AccessHelper.MakeInParam("FileName", AccessHelper.CheckForNullString(fi.FileName));
        pars[2] = AccessHelper.MakeInParam("Content", AccessHelper.CheckForNullString(fi.Content));
        pars[3] = AccessHelper.MakeInParam("FileTypeID", System.Data.OleDb.OleDbType.Integer, 4, AccessHelper.CheckForNullObject(fi.FileTypeID));

        int result = AccessHelper.ExecuteNonQuery(strConn, System.Data.CommandType.Text, sql, pars);
        if (result > 0)
        {
            TextBox1.Text = "你好，陈公公了";
        }
        else
        {
            TextBox1.Text = "= =!";
        }

        // simple method
        string strCmd = string.Format("insert into SearchHistory (FileID, Remark, LatestDate )"
             + "values ({0}, '{1}', '{2}' )", iFileID, strRemark, DateTime.Now.ToShortDateString());
     */
}
